package com.spring;

import java.io.File;
import java.net.URL;

public class ZhouyuApplicationContext {
    private Class configClass;

    public ZhouyuApplicationContext(Class configClass) {
        this.configClass = configClass;
        ComponentScan componentScan = (ComponentScan) configClass.getDeclaredAnnotation(ComponentScan.class);
        String path = componentScan.value();
        path = path.substring(path.indexOf("com"), path.indexOf(".class"));
        ClassLoader classLoader = ZhouyuApplicationContext.class.getClassLoader();
        URL resource = classLoader.getResource("com/zhouyu/service");
        String filePath = resource.getFile();
        File file = new File(filePath);
        try {
            classLoader.loadClass("");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }

    public Object getBean() {
        return null;
    }
}
